import App from '@gis/lib/App.vue';
import env from '@gis/lib/env.js';
import vueGlobalProperty from '@gis/lib/vueGlobalProperty.js';
import vueGlobal from '@gis/lib/vueGlobal.js';
import antDesign from '@gis/lib/plugins/antDesign.js';
import axios from '@gis/lib/plugins/axios.js';
import pinia from '@gis/lib/plugins/pinia.js';
import vbus from '@gis/lib/utils/vBus.js';
import enums from '@gis/lib/enums/index.js';
import resolver from '@gis/lib/utils/resolver.js';
import antdDialog from '@gis/lib/components/antd-dialog/index.js';
import useVexTable from '@gis/lib/components/vex-table/useVexTable.js';
import useAlibabaPuHuiTi from '@gis/lib/fonts/Alibaba-PuHuiTi.js';
import useTheme from '@gis/lib/theme/index.js';
import StaticDataForm from '@gis/lib/components/static-data-form/index.js';
import staticFormOption from './config/staticFormOption.js';

import { createApp } from 'vue';
import useRouter from './router/index.js';

import '@gis/lib/style/theme-antdv-dark.less';
import '@gis/lib/style/theme-vxe-dark.less';
import '@gis/lib/style/index.less';
import './style.less';

useAlibabaPuHuiTi();
useTheme('dark');

let staticDataForm = new StaticDataForm(staticFormOption);
const app = createApp(App, {
  onVnodeMounted() {
    staticDataForm.register();
  },
  onVnodeUnmounted() {
    staticDataForm.unregister();
    staticDataForm = null;
  },
});

app.use(vueGlobalProperty);
app.use(vueGlobal);
app.use(vbus);
app.use(enums);
app.use(resolver);
app.use(antDesign);
app.use(axios);
app.use(pinia);
app.use(antdDialog);
app.use(useVexTable);
app.use(useRouter);

app.mount('#app');

console.log(env);
